<?php require_once 'MyLibrary/Chang_Title.php';?>	    
    <?php if(!empty($this->products)){?>
			<div id="show-product">
			<?php foreach ($this->products as $item_product) {?>
				<div class="product">
                    <div class="product-name">
                        <a href=""><?php echo $item_product['product_name']?></a>
                    </div>
                    <div class="product-image">
                        <a href="<?php echo $this->baseUrl('san-pham/chi-tiet/').$item_product['product_id'] .'-'. MyLibrary_Change_Title::Change_Title($item_product['product_name']) .'.html'?>">
                            <img src="<?php echo $this->baseUrl('default/images/products/') .$item_product['product_image']?>" alt="<?php echo $item_product['product_image']?>"/></a>
                    </div>
                    <div class="product-price">
                        <p>Giá: <?php echo number_format($item_product['product_price'], 0, ',', '.') .'đ'?></p>
                    </div>
                    <div class="product-submit">
                        <a class="add" href="<?php echo $this->baseUrl('cart/add/productid/') .$item_product['product_id']?>">Đặt hàng</a>
                        <a href="<?php echo $this->baseUrl('san-pham/chi-tiet/'). $item_product['product_id']. '-'. MyLibrary_Change_Title::Change_Title($item_product['product_name']). '.html'?>" class="detail">Chi tiết</a>
                    </div>
                </div><!--end .product-->
                <?php }?>
                <div class="clearb"></div>
                </div><!-- end show-product -->
            <?php if($this->products->Count() > 1) {?>                
                <div id="paginator">
                     <?php echo $this->paginationControl($this->products, 'Sliding', 'index/pagination.phtml')?>
                     <div class="clearb"></div>
                </div>
            <?php }?>
      <?php }?>
<script>
// $(document).ready(function(){
//     $('a.add').click(function(){
//         var link = $(this).attr("href");
//         //alert(link);
//         $.ajax({
//             url: link,
//             });
        var cart = "<?php echo $this->baseUrl('cart/index')?>";
//         //alert(cart);
//         $.get(cart, null, function(data){
//             $('#shopping-cart').empty();
//             $('#shopping-cart').html(data);
//             });
//         return false;
//         });
	
// });
</script>